|
smartbuck6 2.2.0
|
API for configuring and manipulating Smart Buck 6 Click driver. More...
Topics | |
| Smart Buck 6 Registers List | |
| List of registers of Smart Buck 6 Click driver. | |
| Smart Buck 6 Registers Settings | |
| Settings for registers of Smart Buck 6 Click driver. | |
| Smart Buck 6 MikroBUS Map | |
| MikroBUS pin mapping of Smart Buck 6 Click driver. | |
Functions | |
| void | smartbuck6_cfg_setup (smartbuck6_cfg_t *cfg) |
| Smart Buck 6 configuration object setup function. | |
| err_t | smartbuck6_init (smartbuck6_t *ctx, smartbuck6_cfg_t *cfg) |
| Smart Buck 6 initialization function. | |
| err_t | smartbuck6_default_cfg (smartbuck6_t *ctx) |
| Smart Buck 6 default configuration function. | |
| err_t | smartbuck6_write_reg (smartbuck6_t *ctx, uint8_t reg, uint8_t data_in) |
| Smart Buck 6 write register function. | |
| err_t | smartbuck6_read_reg (smartbuck6_t *ctx, uint8_t reg, uint8_t *data_out) |
| Smart Buck 6 read register function. | |
| void | smartbuck6_enable_device (smartbuck6_t *ctx) |
| Smart Buck 6 enable device function. | |
| void | smartbuck6_disable_device (smartbuck6_t *ctx) |
| Smart Buck 6 disable device function. | |
| uint8_t | smartbuck6_get_pg_pin (smartbuck6_t *ctx) |
| Smart Buck 6 get power-good pin function. | |
| err_t | smartbuck6_check_com (smartbuck6_t *ctx) |
| Smart Buck 6 check communication function. | |
| err_t | smartbuck6_read_status (smartbuck6_t *ctx, smartbuck6_status_t *status) |
| Smart Buck 6 read status registers function. | |
| err_t | smartbuck6_clear_status (smartbuck6_t *ctx) |
| Smart Buck 6 clear status flags function. | |
| err_t | smartbuck6_enable_buck (smartbuck6_t *ctx, uint8_t buck_sel) |
| Smart Buck 6 enable selected buck function. | |
| err_t | smartbuck6_disable_buck (smartbuck6_t *ctx, uint8_t buck_sel) |
| Smart Buck 6 disable selected buck function. | |
| err_t | smartbuck6_set_buck_vout (smartbuck6_t *ctx, uint8_t buck_sel, uint16_t vout_mv) |
| Smart Buck 6 set output voltage function. | |
| err_t | smartbuck6_read_buck_current (smartbuck6_t *ctx, uint8_t buck_sel, uint16_t *current_ma) |
| Smart Buck 6 read buck output current function. | |
API for configuring and manipulating Smart Buck 6 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
| void smartbuck6_cfg_setup | ( | smartbuck6_cfg_t * | cfg | ) |
Smart Buck 6 configuration object setup function.
This function initializes Click configuration structure to initial values.
| [out] | cfg | : Click configuration structure. See smartbuck6_cfg_t object definition for detailed explanation. |
| err_t smartbuck6_check_com | ( | smartbuck6_t * | ctx | ) |
Smart Buck 6 check communication function.
This function checks communication by reading and verifying the PART ID register.
| [in] | ctx | : Click context object. See smartbuck6_t object definition for detailed explanation. |
0 - Success, -1 - Error. | err_t smartbuck6_clear_status | ( | smartbuck6_t * | ctx | ) |
Smart Buck 6 clear status flags function.
This function clears global and buck-specific overcurrent status flags.
| [in] | ctx | : Click context object. See smartbuck6_t object definition for detailed explanation. |
0 - Success, -1 - Error. | err_t smartbuck6_default_cfg | ( | smartbuck6_t * | ctx | ) |
Smart Buck 6 default configuration function.
This function executes a default configuration of Smart Buck 6 Click board.
| [in] | ctx | : Click context object. See smartbuck6_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t smartbuck6_disable_buck | ( | smartbuck6_t * | ctx, |
| uint8_t | buck_sel ) |
Smart Buck 6 disable selected buck function.
This function disables one or more buck regulators by clearing their control bits.
| [in] | ctx | : Click context object. See smartbuck6_t object definition for detailed explanation. |
| [in] | buck_sel | : Buck regulator selection mask (e.g. SMARTBUCK6_BUCK_A, BUCK_B, BUCK_C, BUCK_ALL). |
0 - Success, -1 - Error. | void smartbuck6_disable_device | ( | smartbuck6_t * | ctx | ) |
Smart Buck 6 disable device function.
This function sets the ON pin to logic high state to disable the device.
| [in] | ctx | : Click context object. See smartbuck6_t object definition for detailed explanation. |
| err_t smartbuck6_enable_buck | ( | smartbuck6_t * | ctx, |
| uint8_t | buck_sel ) |
Smart Buck 6 enable selected buck function.
This function enables one or more buck regulators by setting their control bits.
| [in] | ctx | : Click context object. See smartbuck6_t object definition for detailed explanation. |
| [in] | buck_sel | : Buck regulator selection mask (e.g. SMARTBUCK6_BUCK_A, BUCK_B, BUCK_C, BUCK_ALL). |
0 - Success, -1 - Error. | void smartbuck6_enable_device | ( | smartbuck6_t * | ctx | ) |
Smart Buck 6 enable device function.
This function sets the ON pin to logic low state to enable the device.
| [in] | ctx | : Click context object. See smartbuck6_t object definition for detailed explanation. |
| uint8_t smartbuck6_get_pg_pin | ( | smartbuck6_t * | ctx | ) |
Smart Buck 6 get power-good pin function.
This function reads the logic level of the PG pin.
| [in] | ctx | : Click context object. See smartbuck6_t object definition for detailed explanation. |
| err_t smartbuck6_init | ( | smartbuck6_t * | ctx, |
| smartbuck6_cfg_t * | cfg ) |
Smart Buck 6 initialization function.
This function initializes all necessary pins and peripherals used for this Click board.
| [out] | ctx | : Click context object. See smartbuck6_t object definition for detailed explanation. |
| [in] | cfg | : Click configuration structure. See smartbuck6_cfg_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t smartbuck6_read_buck_current | ( | smartbuck6_t * | ctx, |
| uint8_t | buck_sel, | ||
| uint16_t * | current_ma ) |
Smart Buck 6 read buck output current function.
This function reads and returns the output current of the selected buck regulator.
| [in] | ctx | : Click context object. See smartbuck6_t object definition for detailed explanation. |
| [in] | buck_sel | : Buck regulator selection (only one buck should be selected). |
| [out] | current_ma | : Pointer to store output current in milliamps. |
0 - Success, -1 - Error. | err_t smartbuck6_read_reg | ( | smartbuck6_t * | ctx, |
| uint8_t | reg, | ||
| uint8_t * | data_out ) |
Smart Buck 6 read register function.
This function reads a single byte of data from the specified register address.
| [in] | ctx | : Click context object. See smartbuck6_t object definition for detailed explanation. |
| [in] | reg | : Register address. |
| [out] | data_out | : Pointer to memory where read data will be stored. |
0 - Success, -1 - Error. | err_t smartbuck6_read_status | ( | smartbuck6_t * | ctx, |
| smartbuck6_status_t * | status ) |
Smart Buck 6 read status registers function.
This function reads the STATUS_0, STATUS_1, and OC_STATUS registers and stores them in the status structure.
| [in] | ctx | : Click context object. See smartbuck6_t object definition for detailed explanation. |
| [out] | status | : Pointer to status structure. See smartbuck6_status_t object definition for detailed explanation. |
0 - Success, -1 - Error. | err_t smartbuck6_set_buck_vout | ( | smartbuck6_t * | ctx, |
| uint8_t | buck_sel, | ||
| uint16_t | vout_mv ) |
Smart Buck 6 set output voltage function.
This function sets the output voltage for one or more buck regulators. It automatically adjusts the voltage range selection and applies reconfiguration if needed.
| [in] | ctx | : Click context object. See smartbuck6_t object definition for detailed explanation. |
| [in] | buck_sel | : Buck regulator selection mask. |
| [in] | vout_mv | : Output voltage in millivolts. |
0 - Success, -1 - Error. | err_t smartbuck6_write_reg | ( | smartbuck6_t * | ctx, |
| uint8_t | reg, | ||
| uint8_t | data_in ) |
Smart Buck 6 write register function.
This function writes a single byte of data to the specified register address.
| [in] | ctx | : Click context object. See smartbuck6_t object definition for detailed explanation. |
| [in] | reg | : Register address. |
| [in] | data_in | : Data byte to be written. |
0 - Success, -1 - Error.